package ${req.packageName};

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModelProperty;

/**
 * ${req.comment!}
 * @author 江路
 * @note generate by codemaker
 */
@Builder
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ${req.clazzName?cap_first} {

	<#if (req.apiurl??)>
	private final String apiurl="${req.apiurl}";
	</#if>
	<#list rsp as item>
	
	<#if (item.remark1??)>
	@ApiModelProperty(value = "${item.remark1}"<#if (item.isRequire)>,required=true</#if><#if (item.remark2??&&item.remark2!="")>,notes="${item.remark2}"</#if>)
	</#if>
	<#if (item.type.typeName=="String" && item.length?? && item.length>0)>
	@Size(max = ${item.length?c},message ="${item.code}字段超过限长（${item.length}）")
	</#if>
	<#if (item.isRequire&&(item.type.number||item.type.collection))>
	@NotNull(message = "${item.remark1!}不能为空(${item.code})")
	<#elseif (item.isRequire)>
	@NotBlank(message = "${item.remark1!}不能为空(${item.code})")
	</#if>
	<#if (item.type.collection)>
	@Valid
	</#if>
	@JsonProperty("${item.srcCode}")
	private ${item.type.typeName} ${item.code};
	</#list>
}